{% extends 'base.html' %}
{% block js %}
<script type="text/javascript" src="/static/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="/static/tiny_mce/textareas.js"></script>
{% endblock %}
{% block title %}Guest Book{% endblock %}
{% block content %}
<h1>Guest Book</h1>
 {% if sendmsg %}
    <h2>Thanks for send message</h2> 
 {% endif %}
  
    {% if pager %}
        {% for message in pager.object_list %}
        <p>{{ message.content|safe }}<span class="nav2links"><br />Posted by: {% if message.sender %}{{ message.sender.username }} {% else %} Unkown User {% endif %} | Date: {{ message.msgdate }} | Topic: {{ message.msgtype }}</span></p>
        <hr />
        {% endfor %}
    {% else %}
      <p>No MSG</p>
    {% endif %}
{% endblock %}

{% block contentbottom %}
 <form action="." method="post" enctype="multipart/form-data">
  <table>
    {{ form.as_table }}
    <tr><td style="text-align:center" colspan="2">
      <input type="submit"
        value="Leave a Message" />
    </td></tr>
  </table>
</form>
{% endblock %}
